package com.xjnt.mnui.controller;

import com.xjnt.frameworks.annotation.AutoInject;
import com.xjnt.frameworks.annotation.Router;
import com.xjnt.frameworks.core.CRUDController;
import com.xjnt.mnui.entity.CardRule;
import com.xjnt.mnui.service.CardRuleService;
import com.xjnt.mnui.service.PortalService;

@Router(name="/mnui/ai/cardRule", view="/mnui/cardRule")
public class CardRuleController extends CRUDController<CardRule, CardRuleService> {

	@AutoInject
	protected CardRuleService cardRuleService;
	
	@AutoInject
	protected PortalService portalService;
	
	@Override
	protected String getBizName() {
		return "卡规则";
	}
	
	@Override
	protected Class<CardRule> getClazz() {
		return CardRule.class;
	}

	@Override
	protected CardRuleService getService() {
		return cardRuleService;
	}

	@Override
	protected void addBefore() {
		setAttr("portals", portalService.findAll());
		super.addBefore();
	}
	
	@Override
	public void editBefore(CardRule model) {
		this.addBefore();
	}
	
	
}
